﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Mooville.QUno"
    x:Class="Mooville.QUno.UpdateWindow"
    Title="Check for Updates"
    Width="400" Height="200"
    ResizeMode="NoResize" ShowInTaskbar="False" SnapsToDevicePixels="True" WindowStartupLocation="CenterOwner">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </Window.Resources>
    <Grid Margin="8">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <StackPanel>
            <TextBlock Text="{Binding Path=Title}" Margin="0,0,0,8" FontWeight="Bold" TextWrapping="WrapWithOverflow"/>
            <ProgressBar 
                Height="16" 
                Margin="0,0,0,8" 
                IsIndeterminate="True" 
                Visibility="{Binding Path=IsWorking, Converter={StaticResource BooleanToVisibilityConverter}}"/>
            <TextBlock Text="{Binding Path=Message}" TextWrapping="WrapWithOverflow"/>
        </StackPanel>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="0">
            <Button
                Content="Get Update" 
                Width="75" Height="23"
                Margin="0,0,8,0"
                IsDefault="True" IsCancel="False" 
                Visibility="{Binding Path=HasUpdate, Converter={StaticResource BooleanToVisibilityConverter}}"
                Command="local:QUnoCommands.GetUpdate"/>
            <Button
                Content="Close" 
                Width="75" Height="23"
                IsDefault="False" IsCancel="True"/>
        </StackPanel>
    </Grid>
</Window>
